﻿using System;
using System.Collections.Generic;

namespace Geometry
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Spaghetti编码
            //点集
            Console.WriteLine("***************点集***************");
            MultiPoint points = new MultiPoint();
            points.WriteLine();
            Point pointA = points.GetPoint("A");
            Point pointC = points.GetPoint("C");
            Point pointD = points.GetPoint("D");
            Point pointF = points.GetPoint("F");
            Point pointN = points.GetPoint("N");
            Point pointO = points.GetPoint("O");
            Point pointP = points.GetPoint("P");
            Point pointQ = points.GetPoint("Q");
            //最小点对距
            Console.WriteLine("\n\n***********点集最小点对***********");
            points.PointPairMinDis();
            //折线
            Console.WriteLine("\n\n***************折线***************");
            List<Point> polylinePoints =
                points.GetPoints("C", "D", "E");
            LineString polyline_CE = new LineString("polyline_CE", polylinePoints);
            polyline_CE.WriteLine();
            //线段
            Console.WriteLine("\n\n***************线段***************");
            Line lineCD = new Line("lineCD", pointC, pointD);
            lineCD.WriteLine();
            //面
            Console.WriteLine("\n\n****************面****************");
            List<Point> polygonPoints =
                points.GetPoints("G", "H", "I", "E", "D", "C", "G");
            Polygon polygon3 = new Polygon("polygon3", polygonPoints);
            polygon3.WriteLine();
            //拓扑关系
            Console.WriteLine("\n\n*************拓扑关系*************");
            Line lineND = new Line("lineND", pointN, pointD);
            PointWtihLineStringRelEnum pointWtihLineRel;

            Console.WriteLine("********点与线段关系********");
            pointWtihLineRel = pointC.GetPointWithLineRel(lineND);
            pointC.WriteLine(pointWtihLineRel, lineND.ID);
            pointWtihLineRel = pointN.GetPointWithLineRel(lineCD);
            pointN.WriteLine(pointWtihLineRel, lineCD.ID);
            pointWtihLineRel = pointO.GetPointWithLineRel(lineCD);
            pointO.WriteLine(pointWtihLineRel, lineCD.ID);
            pointWtihLineRel = pointP.GetPointWithLineRel(lineCD);
            pointP.WriteLine(pointWtihLineRel, lineCD.ID);
            pointWtihLineRel = pointQ.GetPointWithLineRel(lineCD);
            pointQ.WriteLine(pointWtihLineRel, lineCD.ID);
            Console.WriteLine("********点与折线关系********");
            pointWtihLineRel = pointN.GetPointWithPolylineRel(polyline_CE);
            pointN.WriteLine(pointWtihLineRel, polyline_CE.ID);
            pointWtihLineRel = pointO.GetPointWithPolylineRel(polyline_CE);
            pointO.WriteLine(pointWtihLineRel, polyline_CE.ID);
            pointWtihLineRel = pointP.GetPointWithPolylineRel(polyline_CE);
            pointP.WriteLine(pointWtihLineRel, polyline_CE.ID);
            pointWtihLineRel = pointQ.GetPointWithPolylineRel(polyline_CE);
            pointQ.WriteLine(pointWtihLineRel, polyline_CE.ID);
            pointWtihLineRel = pointA.GetPointWithPolylineRel(polyline_CE);
            pointA.WriteLine(pointWtihLineRel, polyline_CE.ID);
            Console.WriteLine("********点与面关系********");
            PointWithPolygonRelEnum pointWithPolygonRel;
            pointWithPolygonRel = pointF.GetPointWithPolygonRel(polygon3);
            pointF.WriteLine(pointWithPolygonRel, polygon3.ID);
            #endregion

            #region DIME编码
            //DIMECollection dIMECollection = new DIMECollection();
            //dIMECollection.WriteLine();
            #endregion

            Console.ReadKey();
        }
    }
}
